import 'package:flutter/material.dart';
import 'package:flutter_jojo_test/common/base/base_container.dart';
import 'package:flutter_jojo_test/common/resource/color.dart';
import 'package:flutter_jojo_test/ui/feed/view.dart';
import 'package:flutter_jojo_test/ui/home/view.dart';
import 'package:flutter_jojo_test/ui/message/view.dart';
import 'package:flutter_jojo_test/ui/mine/view.dart';
import 'package:flutter_jojo_test/widget/main_bottom_bar.dart';
import 'package:get/get.dart';

import 'logic.dart';

class MainPage extends StatelessWidget {
  var body = [HomePage(), FeedPage(), MessagePage(), MinePage()];

  @override
  Widget build(BuildContext context) {
    final logic = Get.put(MainLogic());
    final state = Get.find<MainLogic>().state;
    return Obx(() => BaseContainer(
          children: [
            Column(
              children: [
                Expanded(
                    child: PageView(
                  children: body,
                  controller: state.controller,
                  physics: const NeverScrollableScrollPhysics(),
                )),
                MainBottomBar(state),
              ],
            )
          ],
          color: ThemeColor.g1.value,
          statusDark: true,
        ));
  }
}
